- /* howdigs.cpp by K.Tsuru */
- // since ver 2.18
- /*****************************************
- SNumber sub-function
- It returns how many digits "x" has in radix "r" i.e.
- a value x which satisfies a condition x<= r^n.
- e.g. x = 25, r = 10 --> n = 2
- *****************************************/
- #ifndef TYPEDEF_H
- #include "typedef.h"
- #endif
-
- uint howdigsrdx(long x, long r) {
- if(x < r) return x ? 1 : 0;
- uint n = 0;
-
- while(x){
- x /= r; n++;
- }
-
- return n;
- }
howdigs.cpp : last modifiled at 2008/04/24 09:52:48(480 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).